package com.study.oauth2demo.config;

import com.study.oauth2demo.entity.UserDto;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

@Configuration
public class ApplicationConfig {

    @Bean
    public Map<String, UserDto> userMap(){

        Map<String, UserDto> map = new HashMap<>();
        Set<String> auth1 = new HashSet<>();
        auth1.add("p1");

        Set<String> auth2 = new HashSet<>();
        auth2.add("p2");

        map.put("zs", new UserDto("zs", "123456", "男", 12, auth1));
        map.put("ls", new UserDto("ls", "123456", "女", 15, auth2));

        return map;
    }
}
